package com.cyy.demo.utils;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ReflectionUtil {

    public static Object exeMethod(Class clz,String methodName,Class[] paramType,Object[] params){
        try {
//			Method method = clz.getMethod(methodName,new Class[]{int.class,String.class});

            Method method = clz.getMethod(methodName, paramType);
            method.setAccessible(true);
            return method.invoke(clz,params);
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        return  null;
    }




}
